/* SPDX-License-Identifier: GPL-2.0 */
/**
 * Copyright (C) 2016-2018, LomboTech Co.Ltd.
 * Author: lomboswer <lomboswer@lombotech.com>
 *
 * memctrl_conf.h - memctrl config head file
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */

#ifndef __MEMCTRL_CONF_H
#define __MEMCTRL_CONF_H

#include <linux/fs.h>

/**
 * mctrl_conf_sysfs_create_group - create sysfs node for memctrl
 * @dev: the device handle to create sysfs node
 *
 * return o if success, other failed
 */
int mctrl_conf_sysfs_create_group(struct device *dev, struct device *pdev);

ssize_t __memctrl_show(struct device *dev,
				struct device_attribute *attr, char *buf);

int lombo_memctrl_bw_ctrl_mode(const char *master, u32 ctrl_mode, int rw);
int lombo_memctrl_bw_randomode(const char *master, u32 randomode, int rw);
int lombo_memctrl_bw_seed(const char *master, u32 seed, int rw);
int lombo_memctrl_bw_timewin(const char *master, u32 timewin, int rw);
int lombo_memctrl_bw_datasize(const char *master, u32 datasize, int rw);

int of_mctrl_set_default_bwctrl(struct device *dev);
int of_mctrl_set_default_priority(struct device *dev);

#endif
